Skip to main content

Week 2 — Rectangular Coordinate System and Straight Lines

1. Rectangular Coordinate System​

A rectangular coordinate system represents points in a plane using two perpendicular axes:

  • x-axis — horizontal axis
  • y-axis — vertical axis
  • Origin — intersection of the two axes

The origin is:

O=(0,0)O=(0,0)

A point in the plane is represented as:

P=(x,y)P=(x,y)

where xx is the x-coordinate and yy is the y-coordinate.


2. Quadrants​

The coordinate plane is divided into four quadrants.

Quadrantxxyy
I++++
II−-++
III−-−-
IV++−-

Points on the x-axis or y-axis do not belong to any quadrant.


3. Distance Between Two Points​

For two points:

P1=(x1,y1)P_1=(x_1,y_1)

and

P2=(x2,y2)P_2=(x_2,y_2)

the distance is:

d=(x2−x1)2+(y2−y1)2d= \sqrt{(x_2-x_1)^2+(y_2-y_1)^2}

4. Distance from the Origin​

For a point:

P=(x,y)P=(x,y)

its distance from the origin is:

OP=x2+y2OP=\sqrt{x^2+y^2}

5. Midpoint of a Line Segment​

For two points:

P1=(x1,y1)P_1=(x_1,y_1)

and

P2=(x2,y2)P_2=(x_2,y_2)

the midpoint is:

M=(x1+x22,y1+y22)M= \left( \frac{x_1+x_2}{2}, \frac{y_1+y_2}{2} \right)

Straight Lines

6. Straight Line​

A straight line is represented by a linear equation in two variables.

The general form is:

Ax+By+C=0Ax+By+C=0

where AA, BB, and CC are constants and AA and BB are not both zero.


7. Slope of a Line​

The slope of a line measures the change in yy for a given change in xx.

For two points:

P1=(x1,y1)P_1=(x_1,y_1)

and

P2=(x2,y2)P_2=(x_2,y_2)

the slope is:

m=y2−y1x2−x1m= \frac{y_2-y_1}{x_2-x_1}

provided:

x2≠x1x_2\neq x_1

Equivalently:

m=ΔyΔxm=\frac{\Delta y}{\Delta x}

8. Interpretation of Slope​

SlopeLine
m>0m>0Increasing
m<0m<0Decreasing
m=0m=0Horizontal
UndefinedVertical

A horizontal line has equation:

y=cy=c

A vertical line has equation:

x=cx=c

9. Slope and Angle of Inclination​

If a line makes an angle θ\theta with the positive x-axis, then:

m=tan⁡θm=\tan\theta

Therefore:

θ=tan⁡−1(m)\theta=\tan^{-1}(m)

Equations of a Straight Line

10. Slope-Intercept Form​

A line with slope mm and y-intercept cc is:

y=mx+cy=mx+c

Here:

  • mm is the slope
  • cc is the y-intercept

The y-intercept is:

(0,c)(0,c)

11. Point-Slope Form​

A line with slope mm passing through:

(x1,y1)(x_1,y_1)

is:

y−y1=m(x−x1)y-y_1=m(x-x_1)

12. Two-Point Form​

A line passing through:

(x1,y1)(x_1,y_1)

and

(x2,y2)(x_2,y_2)

is:

y−y1=y2−y1x2−x1(x−x1)y-y_1 = \frac{y_2-y_1}{x_2-x_1} (x-x_1)

provided:

x2≠x1x_2\neq x_1

13. Intercept Form​

If a line has x-intercept aa and y-intercept bb, its equation is:

xa+yb=1\frac{x}{a}+\frac{y}{b}=1

where a≠0a\neq0 and b≠0b\neq0.


14. General Form​

The general equation of a straight line is:

Ax+By+C=0Ax+By+C=0

If B≠0B\neq0, then:

y=−ABx−CBy=-\frac{A}{B}x-\frac{C}{B}

Therefore:

m=−ABm=-\frac{A}{B}

and

c=−CBc=-\frac{C}{B}

Parallel and Perpendicular Lines

15. Parallel Lines​

Two non-vertical lines are parallel if their slopes are equal:

m1=m2m_1=m_2

16. Perpendicular Lines​

Two non-vertical lines are perpendicular if:

m1m2=−1m_1m_2=-1

Therefore:

m2=−1m1m_2=-\frac{1}{m_1}

A horizontal line and a vertical line are also perpendicular.


Distance from a Point to a Line

17. Point-to-Line Distance​

For a line:

Ax+By+C=0Ax+By+C=0

and a point:

P=(x0,y0)P=(x_0,y_0)

the perpendicular distance between them is:

d=∣Ax0+By0+C∣A2+B2d= \frac{|Ax_0+By_0+C|} {\sqrt{A^2+B^2}}

Straight-Line Fit

18. Data Points and Straight-Line Fit​

Suppose we have data points:

(x1,y1),(x2,y2),…,(xn,yn)(x_1,y_1),(x_2,y_2),\ldots,(x_n,y_n)

A straight-line fit attempts to represent the relationship between xx and yy using:

y^=mx+c\hat y=mx+c

where:

  • mm is the slope
  • cc is the intercept
  • y^\hat y is the predicted value of yy

19. Residual​

For an observed value yiy_i and predicted value y^i\hat y_i, the residual is:

ei=yi−y^ie_i=y_i-\hat y_i

For a fitted line:

y^i=mxi+c\hat y_i=mx_i+c

the residual is:

ei=yi−(mxi+c)e_i=y_i-(mx_i+c)

20. Least-Squares Method​

The least-squares method chooses mm and cc such that the sum of squared residuals is minimized.

The objective function is:

S(m,c)=∑i=1n[yi−(mxi+c)]2S(m,c) = \sum_{i=1}^{n} \left[y_i-(mx_i+c)\right]^2

The fitted line is:

y^=mx+c\hat y=mx+c

where mm and cc minimize S(m,c)S(m,c).


21. Mean of Data​

The mean of the x-values is:

xˉ=1n∑i=1nxi\bar{x} = \frac{1}{n} \sum_{i=1}^{n}x_i

The mean of the y-values is:

yˉ=1n∑i=1nyi\bar{y} = \frac{1}{n} \sum_{i=1}^{n}y_i

22. Least-Squares Slope​

The slope of the least-squares fitted line is:

m=∑i=1n(xi−xˉ)(yi−yˉ)∑i=1n(xi−xˉ)2m= \frac{ \sum_{i=1}^{n} (x_i-\bar{x})(y_i-\bar{y}) }{ \sum_{i=1}^{n} (x_i-\bar{x})^2 }

provided the denominator is non-zero.


23. Least-Squares Intercept​

Once mm is known:

c=yˉ−mxˉc=\bar{y}-m\bar{x}

Therefore, the fitted line can also be written as:

y^=yˉ+m(x−xˉ)\boxed{ \hat y = \bar{y}+m(x-\bar{x}) }